how to stop enemies from moving to one point when lots of them are chasing one object [duplicate]

Posted by BBgun on Game Development See other posts from Game Development or by BBgun
Published on 2013-11-11T12:30:05Z Indexed on 2013/11/11 16:18 UTC
Read the original article Hit count: 236

Filed under:
|
|

This question already has an answer here:

i am making a top down game which lots of enemies are chasing one guy.

then,enemies would move to one point without any collision,they just overlay each other.

so ,is there any simple way to make them feel more real? make them not overlay with each other?

=================================

i have tried the solution using boundbox to check collision,

but i still very puzzled about what to do with the collision.

i have a bad solution.it doesn't work well.

my solution in simple:

foreach(around_enemy_arr in other)

{

vector a = normalize(self.positionvector - other.positionvector);

self.move_vector = self.move_vector + a;

}

this can work,but when plenty of enemies come very close to each other,they would shake.

i am sooooo confused.

please help.

© Game Development or respective owner

Related posts about game-design

Related posts about physics